package mk.jug.academy.model;

import javax.persistence.Column;
import javax.persistence.Entity;

/**
 * Entity modeling an admin of the Java Academy initiative.
 *
 * @author Ice.Penov
 */
@Entity @SuppressWarnings("serial")
public class Administrator extends User {
	
	public static final String CODE_PREFIX = "ADM-";
	
	@Column(nullable = false)
	private String name;
	
	public Administrator() {
		setRole(UserType.ADMIN.toString());
	}
		
	@Override
	public String getDisplayName() {
		return name;
	}	
	
	/**
	 * Returns the name.
	 */
	public String getName() {
		return name;
	}

	/**
	 * Setter for the name.
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * The code identifier of the entity. 
	 */
	public String getCode() {
		return CODE_PREFIX + getId();
	}

}
